<template>
    <div class="historyctx">
            <div class="history-container">
                <div class="history-img">
                    <img :src="data.vertical_cover" alt="">
                </div>
                <div class="history-title">
                    <div class="title-top">{{data.title}}</div>
                    <div class="title-bottom">看到{{zhangId+1}}话/共{{data.total}}话</div>
                </div>
                <div class="history-btn" @click="gotoCartoon"><div class="btn-name">续看</div></div>
            </div>
    </div>
</template>

<script>
    export default {
        props:['id','zhangId'],
        data(){
            return{
                data:[]
            }
        },
        created(){
            this.axios({
            methods:'GET',
            url:'ComicDetail',
            params:{
                comicId:this.id
            }
        }).then(result=>{
            this.data = result.data.data;
        })
        },
        methods:{
            gotoCartoon(){
            this.$router.push({name:"chapter",query:{id:this.id,Zid:this.zhangId}})
        }
        }
    }
</script>

<style lang="less" scoped>
        .historyctx{
            margin-bottom: 10px;
        }
        .history-container{
            display: flex;
            width: 100%;
            .history-img{
                height: 110px;
                border-radius: 5px;
                overflow: hidden;
                > img {
                    height: 100%;
                    display: block;
                }
            }
            .history-title{
                flex: 1;
                padding-left: 15px;
                display: flex;
                flex-direction: column;
                justify-content: space-between;
                .title-top{
                    font-weight: bold;
                    font-size: 15px;
                }
            }
            .history-btn{
                margin-left: auto;
                display: flex;
                align-items: center;
                padding-right: 5px;
                .btn-name{
                    padding: 5px 20px;
                    background-color: #32AAFF;
                    border-radius: 15px;
                    color: white;
                }
                
            }
        }
</style>